extends PlayStatusInterface

# 物理桢，处理碰撞的逻辑
func run_physics_process(_delta):
	var collision_info = owner.move_and_collision_info()
	if not collision_info.get("is_on_floor") && collision_info.get("was_on_floor"):
		manage_node.to_fall()
		return
			
# 逻辑桢，处理画面的逻辑
func run_process(delta):
	#1. 速度通用处理
	var direction = owner.common_velocity(delta)
	if direction == 0:
		if owner.velocity.x == 0:
			manage_node.to_idle()
		
	#2. 状态变更新
	var num = owner.can_jump()
	if num > 0:
		manage_node.to_jump()
		return

	#3. 播放动画
	owner.show_animiation("walk")
